package com.allqj.sfx.ddd.member.application.assembler;

import com.allqj.sfx.application.assembler.DTOAssembler;
import com.allqj.sfx.ddd.member.application.dto.FlowTaskDefDTO;
import com.allqj.sfx.ddd.member.domain.entity.flow.FlowTaskDef;
import org.springframework.beans.BeanUtils;

/**
 * @author sjw
 * @className FlowDefAssember
 * @date 2022/7/22 18:47
 * @description: FlowTaskDefDTO&FlowTaskDef 转换类
 * DTO与entity之间的转换
 */
public class FlowTaskDefAssember implements DTOAssembler<FlowTaskDefDTO, FlowTaskDef> {

    public static FlowTaskDefAssember INSTANCE = new FlowTaskDefAssember();

    @Override
    public FlowTaskDef dto2Entity(FlowTaskDefDTO flowTaskDefDTO) {
        if (flowTaskDefDTO == null) return null;
        FlowTaskDef flowTaskDef = new FlowTaskDef();
        BeanUtils.copyProperties(flowTaskDefDTO, flowTaskDef);
        return flowTaskDef;
    }

    @Override
    public FlowTaskDefDTO entity2DTO(FlowTaskDef flowTaskDef) {
        return null;
    }
}
